package nio;

import java.nio.ByteBuffer;

/**
 * Created by IntelliJ
 * Author:熊磊
 */
public class ByteBufferGetPut {
    public static void main(String[] args) {
        ByteBuffer buf = ByteBuffer.allocate(64);

        buf.putInt(100);
        buf.putLong(9L);
        buf.putChar('熊');
        buf.putShort((short) 4);

        buf.flip();

        System.out.println((char) 618890);

        System.out.println(buf.getLong());
        System.out.println(buf.getChar());
        System.out.println(buf.getInt());

        System.out.println(buf.getShort());
    }
}
